$OpenBSD: README-main,v 1.9 2014/12/07 19:24:10 jasper Exp $

+-----------------------------------------------------------------------
| Running ${FULLPKGNAME} on OpenBSD
+-----------------------------------------------------------------------

Web frontend
------------
PuppetDB comes with a web frontend which reports various metric at:

    http://<hostname>:8080

Setting up SSL
--------------
In order for the PuppetDB to communicate with the Puppet Master you will need
to setup SSL.

As the Puppet Master need not to run on the same host as PuppetDB we will
assume your configuration is stored in ${SYSCONFDIR}/puppet/ on
OpenBSD or ${SYSCONFDIR}/puppet/ on most other operating systems.

Now manually copy over the following .pem files from your Puppet Master into
${SYSCONFDIR}/puppetdb/ssl/ (relative to ${SYSCONFDIR}/puppet/):

    ssl/certs/ca.pem
    ssl/private_keys/<puppet master certname>.pem
    ssl/certs/<puppet master certname>.pem

In order to finalize the setup now run these commands, though if the Puppet
Master runs on the same host as PuppetDB, the first command can be skipped:

    # ${LOCALBASE}/libexec/puppetdb/puppetdb-ssl-setup
    # puppetdb ssl-setup -f

PostgreSQL indexes
------------------
When using the PostgreSQL database, it is strongly recommended to
create the pg_trgm indexes for the PuppetDB database. This extension
can be installed with:

    # pkg_add postgresql-contrib

Then run the following command as the database super-user on the PuppetDB
database:

    puppetdb=# CREATE EXTENSION pg_trgm;

And restart puppetdb:

    # rcctl restart puppetdb

Configuring the Puppet Master
-----------------------------
Several steps are needed on the Puppet Master to make use of PuppetDB for
storing facts, reports as well as exported resources and stored
configurations.

First create ${SYSCONFDIR}/puppet/routes.yaml so Puppet can store facts to PuppetDB:

    ---
      master:
        facts:
          terminus: puppetdb
          cache: yaml

Next create ${SYSCONFDIR}/puppet/puppetdb.conf to teach Puppet how to reach PuppetDB:

    [main]
      server = puppetdb.example.com
      port   = 8081

Finally instruct Puppet to use PuppetDB for stored configs and reports; in the
'[master]' section of ${SYSCONFDIR}/puppet/puppet.conf:

    reports      = store,puppetdb
    storeconfigs = true
    storeconfigs_backend = puppetdb

PuppetDB terminus
-----------------
If the Puppet Master is running OpenBSD, you will need to install the PuppetDB
terminus plugin:

    # pkg_add puppetdb-terminus

Upgrade from puppetdb-2.1.0p0
-----------------------------
With puppetdb-2.1.0p1 the single ${SYSCONFDIR}/puppetdb/conf.d/puppetdb.ini file was
split into multiple .ini files. There are now config.ini, database.ini, jetty.ini and
repl.ini. The config.ini contains the [global] and [command-processing] sections,
the other .ini files contain the respective sections from the puppetdb.ini with
the same names. You have to update those new files matching your old configuration
from the puppetdb.ini and afterwards you have to delete the
puppetdb.ini file before restarting puppetdb.
